package com.javafamily.service;

import com.javafamily.bean.Pets;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Component
@RequestMapping("/fallback/consumer/pet")
public class PetFallback implements PetService {
    @Override
    public boolean savePets(Pets pets) {
        System.out.println("savePets--Factory");
        return false;
    }

    @Override
    public boolean removePetsById(Integer id) {
        System.out.println("removePets--Factory");
        return false;
    }

    @Override
    public boolean modifyPets(Pets pets) {
        System.out.println("modifyPets--Factory");
        return false;
    }

    @Override
    public Pets getPetsById(Integer id) {
        System.out.println("getPets--Factory");
        Pets pets1 = new Pets();
        pets1.setId(id);
        pets1.setName("get pets failed--Factory");
        return pets1;
    }

    @Override
    public List<Pets> listAllPets() {
        System.out.println("listAllPets--Factory");
        return null;
    }
}
